package com.xayy.health.mgt.model;

import cn.kawins.mybatis.base.BaseModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import tk.mybatis.mapper.annotation.KeySql;
import tk.mybatis.mapper.code.IdentityDialect;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * @author Nie
 * @version V1.0
 * @date 2023/4/10 10:08
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table(name = "HEALTH.health_assess_task")
public class HealthAssessTask extends BaseModel<Long> {
    @Id
    @Column(name = "id")
    @KeySql(dialect = IdentityDialect.MYSQL)
    @ApiModelProperty(value = "主键", accessMode = ApiModelProperty.AccessMode.READ_ONLY)
    private Long id;

    @Column(name = "satellite_mid")
    @ApiModelProperty(value = "卫星标识", required = true)
    private Long satelliteMid;

    @Column(name = "satellite_name")
    @ApiModelProperty(value = "卫星名称", required = true)
    private String satelliteName;

    @Column(name = "task_start_time")
    @ApiModelProperty(value = "任务开始时间", required = true)
    private Date taskStartTime;

    @Column(name = "task_current_time")
    @ApiModelProperty(value = "任务最新执行结束时间")
    private Date taskCurrentTime;

    @Column(name = "task_period")
    @ApiModelProperty(value = "任务周期", required = true)
    private Integer taskPeriod;

    @Column(name = "task_state")
    @ApiModelProperty(value = "任务状态（0：停止1：运行）")
    private Integer taskState;

    @Column(name = "task_period_type")
    @ApiModelProperty(value = "任务周期单位（0：分1：时2：天）", required = true)
    private Integer taskPeriodType;

    @Column(name = "last_task_time")
    @ApiModelProperty(value = "最后一次执行任务得时间")
    private Date lastTaskTime;

    @Override
    public Long idValue() {
        return id;
    }
}
